package com.bong.ring.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.bong.ring.fragment.TabFragmentBong;
import com.bong.ring.fragment.TabFragmentData;
import com.bong.ring.fragment.TabFragmentMe;


/**
 * Created by PanXuesen on 2018/2/2.
 */

public class MyPageAdapter extends FragmentPagerAdapter {
    Fragment[] items;

    public MyPageAdapter(FragmentManager fm) {
        super(fm);
        items = new Fragment[3];
        items[0] = TabFragmentBong.newInstance("", "");
        items[1] = TabFragmentData.newInstance("", "");
        items[2] = TabFragmentMe.newInstance("", "");
    }

    @Override
    public Fragment getItem(int position) {
        return items[position];
    }

    @Override
    public int getCount() {
        if (items == null)
            return 0;
        return items.length;
    }
}
